package cn.snmp.mutual.filter;
import cn.snmp.mutual.data.ObjService;
/**
 * Mib Node Filter
 * @author dengkn
 * mib 下发可以配置过滤器节点默认实现isFilter（），实现自己想要的过滤条件
 * */
public class SingleNodeFilter extends AbstractFilter {
	@Override
	public boolean isFilter(ObjService tableInfo, ObjService rowSet) {
		ObjService filterInfo = this.tableStruct.objectAt("Filter", 0);
		String filterNode = filterInfo.getStringValue("FilterNode");
		String filterValue = filterInfo.getStringValue("FilterValue");
		String filterType = filterInfo.getStringValue("FilterType");
		String value = rowSet.getStringValue(filterNode);
		return filterType.equalsIgnoreCase("==") && value.equalsIgnoreCase(filterValue)
				? true : filterType.equalsIgnoreCase("<>") && !value.equalsIgnoreCase(filterValue);
	}
}